namespace ScrumSprintMonitor.UI.Wpf.Converters
{
	#region #using Directives

	using System;
	using System.Globalization;
	using System.Windows.Data;

	using Infrastructure;

	using Properties;

	#endregion

	public class RemainingWorkStatusTextValueConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			if (value != null && value is RemainingWorkStatus)
			{
				var val = (RemainingWorkStatus) value;

				switch (val)
				{
					case RemainingWorkStatus.NoWorkLeft:
						return Resources.RemainingWorkStatus_NoWorkLeft;
					case RemainingWorkStatus.SeverelyUnderassigned:
						return Resources.RemainingWorkStatus_SeverelyUnderassigned;
					case RemainingWorkStatus.Underassigned:
						return Resources.RemainingWorkStatus_Underassigned;
					case RemainingWorkStatus.Normal:
						return Resources.RemainingWorkStatus_Normal;
					case RemainingWorkStatus.Warning:
						return Resources.RemainingWorkStatus_Warning;
					case RemainingWorkStatus.Overassigned:
						return Resources.RemainingWorkStatus_Overassigned;
					case RemainingWorkStatus.SeverelyOverassigned:
						return Resources.RemainingWorkStatus_SeverelyOverassigned;
					default:
						throw new ArgumentOutOfRangeException("value");
				}
			}

			return null;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}